package org.openurp.edu.student.info.model

import java.text.SimpleDateFormat
import scala.beans.BeanProperty
import org.beangle.data.model.LongId
import org.beangle.commons.collection.Collections

/**
 * @author King Sun
 */
class Student extends LongId {

  @BeanProperty
  var code: String = _

  @BeanProperty
  var name: String = _

  @BeanProperty
  var gender: Gender = _

  @BeanProperty
  var nationality: String = _

  @BeanProperty
  var passportNo: String = _

  var studentWai: StudentWai = _

  def getBirthdayDate(): String = {
    if (null == birthday) ""
    else {
      new SimpleDateFormat("YYYY-MM-dd").format(birthday)
    }
  }

  var birthday: java.sql.Date = _

  @BeanProperty
  var major: String = _

  @BeanProperty
  var scholarship: Scholarship = _

  def getVisaDate(): String = {
    if (null == visadate) ""
    else {
      new SimpleDateFormat("YYYY-MM-dd").format(visadate)
    }
  }

  var visadate: java.sql.Date = _

  @BeanProperty
  var tel: String = _

  @BeanProperty
  var wechat: String = _

  @BeanProperty
  var email: String = _

  @BeanProperty
  var address: String = _

  @BeanProperty
  var stdNo: String = _

  @BeanProperty
  var classes: String = _

  @BeanProperty
  var landlord: String = _

  @BeanProperty
  var stdtype: Stdtype = _

  var checkinstate: Checkinstate = _
  def getCheckin(): String = {
    if (null == checkinDate) ""
    else {
      new SimpleDateFormat("YYYY-MM-dd").format(checkinDate)
    }
  }
  var checkinDate: java.sql.Date = _

  @BeanProperty
  var latetimes: String = _

  @BeanProperty
  var skiptimes: String = _

  @BeanProperty
  var notes: String = _

}
